#ifndef _ABSTRACT_PARSER_HPP_20120716
#define _ABSTRACT_PARSER_HPP_20120716

namespace mina
{
	class ListBuffer;

	class AbstractParser
	{
		public :
			virtual ~AbstractParser() {}

			/**
			 * serialize data to listbuffer
			 *
			 * @param listbuffer encode buffer
			 * @param data encode data
			 * @retval 0 success, -1 fail
			 *
			 */
			
			virtual int encode(ListBuffer & listbuffer, void * data)  = 0;

			/**
			 * unserialize listbuffer to data
			 *
			 * @param listbuffer decode buffer
			 * @param data decode data
			 * @retval 0 success, -1 fail
			 *
			 */

			virtual int decode(ListBuffer & listbuffer, void *& data) = 0;
	};
};

#endif

